
public class WhileStmt {
	String wh ;
	String lp;
	Expression exp;
	String rp;
	Statement st;
	public WhileStmt(String wh, String lp, Expression exp, String rp, Statement st){
		this.wh = wh;
		this.lp = lp;
		this.exp = exp;
		this.rp = rp;
		this.st = st;
	}
	public String toString(){
		String ret = "WhileStmt\n";

		String s = "";

		if (exp != null) {
			s +=  exp.toString();
		}
		if (st != null) {
			s +=  st.toString();
		}
		for(String st: s.split("\n")){
			if(st!= "")
				ret += "| " + st + "\n";
		}
		return ret;
	}
	public void check() throws SemanticException {
		SymbolTable table = SymbolTable.getInstance();
		if (st != null) {
			st.check();
		}
	}
}
